package com.entity.user;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("user")
public class User {

    @ApiModelProperty(value = "用户ID，主键，自增")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "用户名，唯一")
    @TableField("username")
    private String username;

    @ApiModelProperty(value = "加密后的密码")
    @TableField("password")
    private String password;

    @ApiModelProperty(value = "邮箱，可选且唯一")
    @TableField("email")
    private String email;

    @ApiModelProperty(value = "手机号，可选且唯一")
    @TableField("mobile")
    private String mobile;

    @ApiModelProperty(value = "昵称")
    @TableField("nickname")
    private String nickname;

    @ApiModelProperty(value = "头像路径")
    @TableField("avatar")
    private String avatar;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "最后登录时间")
    @TableField("last_login_time")
    private LocalDateTime lastLoginTime;

    @ApiModelProperty(value = "用户状态（如 ENABLED/DISABLED）")
    @TableField("status")
    private String status;

    @ApiModelProperty(value = "是否锁定")
    @TableField("locked")
    private Boolean locked;

    @ApiModelProperty(value = "失败登录次数")
    @TableField("failed_attempts")
    private Integer failedAttempts;

    @ApiModelProperty(value = "微信openid")
    @TableField("openid")
    private String openid;

    @ApiModelProperty(value = "用户当前位置")
    @TableField("location")
    private String location;
}